﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditUserInfo.aspx.cs" Inherits="AntiObesity.Services.EditUserInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server"><title>Edit User Info</title>
<link href="css/reset.css" rel="stylesheet" type="text/css" />
<script src="Contents/jquery.js" type="text/javascript"></script>
<script src="Contents/jquery-ui.js" type="text/javascript"></script>
<script src="Contents/jquery-autocomplete.js" type="text/javascript"></script>
<script src="Contents/jquery-validate.js" type="text/javascript"></script>
<script src="Contents/jquery.en-GB.js" type="text/javascript"></script>
<script src="Contents/jquery.fancybox-1.3.0.pack.js" type="text/javascript"></script>
<link href="Contents/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<link href="Contents/css/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="Contents/jquery.fancybox-1.3.0.css" rel="stylesheet" type="text/css" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel runat="server">
        <ContentTemplate>
            <h1>
                Edit Your Information</h1>
            <span class="edit-user-info">
                <span class="form">
                    <span class="items-body">
                        <span class="item">
                            <span class="label">
                                <label for="txtDateOfBirth">Date of Birth:</label>
                            </span>
                            <span class="input">
                                <asp:TextBox class="required" ID="txtDateOfBirth" runat="server" Width="100"></asp:TextBox>
                            </span>
                        </span>
                        <span class="item">
                            <span class="label">
                                <label for="txtSex">Sex:</label>
                            </span>
                            <span class="input">
                                <asp:RadioButtonList ID="rduSex" runat="server">
                                    <asp:ListItem Text="Male" Value="false" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="Female" Value="true"></asp:ListItem>
                                </asp:RadioButtonList>
                            </span>
                        </span>
                        <span class="item">
                            <span class="label">
                                <label for="txtHeight">Height:</label>
                            </span>
                            <span class="input">
                                <asp:TextBox class="required" ID="txtHeight" runat="server" Width="100"></asp:TextBox>
                            </span>
                            <span class="info">(centimeter)</span>
                        </span>
                        <span class="item">
                            <span class="label">
                                <label for="txtWeight">Weight:</label>
                            </span>
                            <span class="input">
                                <asp:TextBox class="required" ID="txtWeight" runat="server" Width="100"></asp:TextBox>
                            </span>
                            <span class="info">(kg)</span>
                        </span>
                    </span>
                    <span class="buttons">
                        <asp:Button Text="Save" ID="btnSave" runat="server" OnClick="btnSave_Click" />
                        <a href="ChangePassword.aspx">Change Password</a> or <a href="UserHome.aspx">Return to Home Page</a> </span>
                </span>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {

            var validator = $("form").validate({
                rules: {
                    txtDateOfBirth: {
                        ukDate: true
                    }
                },
                errorPlacement: function(error, element) {
                    if (element.hasClass('hasDatepicker'))
                        error.insertAfter(element.next());
                    else {
                        var info = element.parent().parent().children('.info');
                        if (info.hasClass('info'))
                            error.insertAfter(info);
                        else
                            error.insertAfter(element);
                    }
                }
            });

            $('#<%# txtDateOfBirth.ClientID %>').datepicker({
                showOn: 'button',
                buttonText: 'Select date',
                buttonImageOnly: true,
                buttonImage: 'images/datePicker.gif',
                changeMonth: true,
                changeYear: true
            });

        });
    </script>
</body>
</html>
